home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_2.lha / 8_2 / 8_2d.c < prev    next >
Text File  |  1993-08-08  |  483b  |  27 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / copy a stream of name_and_address objects
  6. include <error.h>
  7. ain(int, char**)
  8.  
  9.    for (;;)
  10. {
  11. name_and_address a;
  12. if (!(cin >> a))
  13.     break;
  14. if (!(cout << a))
  15.     break;
  16. name_and_address b = a;
  17. if (!(cout << b))
  18.     break;
  19. }
  20.  
  21.    if (!cin.eof())
  22. error("error reading input");
  23.    if (cout.bad())
  24. error("error writing output");
  25.    return 0;
  26.  
  27.